home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!seismo!ut-sally!im4u!rutgers!mit-eddie!uw-beaver!tektronix!tekgen!tekred!games-request
- From: games-request@tekred.TEK.COM
- Newsgroups: comp.sources.games
- Subject: v02i040: dungeon - game of adventure, Part07/14
- Message-ID: <1563@tekred.TEK.COM>
- Date: 1 Sep 87 20:38:26 GMT
- Sender: billr@tekred.TEK.COM
- Lines: 2239
- Approved: billr@tekred.TEK.COM
-
- Submitted by: Bill Randle <games-request@tekred.TEK.COM>
- Comp.sources.games: Volume 2, Issue 40
- Archive-name: dungeon/Part07
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 7 (of 14)."
- # Contents: Makefile PDP.doc advers.h ballop.F cinit.c cio.c cspeak.c
- # curxt.h debug.h decode.c dso1.F dso3.F dso4.F dso5.F dso6.F dso7.F
- # dungeon.sh exits.h files.h flags.h gamestate.h io.h lightp.F
- # listen.c mindex.h oindex.h parser.h puzzle.h rflag.h rooms.h
- # rtim.c screen.h state.h villians.h vocab.h xpars.h xsrch.h
- # Wrapped by billr@tekred on Tue Apr 21 10:24:39 1987
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f Makefile -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"Makefile\"
- else
- echo shar: Extracting \"Makefile\" \(1818 characters\)
- sed "s/^X//" >Makefile <<'END_OF_Makefile'
- X# Makefile for creating dungeon
- X# Edit BIN DDIR and FFLAGS suitable for your system
- X.c.o:
- X cc -c $(CFLAGS) $*.c
- X.F.o:
- X f77 -c $(FFLAGS) $*.F
- X
- XCFLAGS = -O # -i
- X#
- X# f77 compiler flags for Vax (and other large address machines)
- X#
- XFFLAGS = -O -q # -Ddebug
- X# f77 compiler flags for pdp (64K split I/D)
- X#FFLAGS = -O -q -I2 -L1 -i -DPDP # -Ddebug
- X
- X# Directory path for main program - default /usr/games
- XBIN = /usr/games
- X# Directory path for data files - default is /usr/games/lib/dunlib
- XDDIR = \'/usr/games/lib/dunlib
- XDCDIR =\"/usr/games/lib/dunlib
- X# Directory path for man page - default /usr/manl/man6
- XMDIR = /usr/manl/man6
- X# userid for wizard - allows invoking game debugging tool - default 0
- XWIZDEF = -DWIZARDID=20
- X
- XOBJS = actors.o ballop.o clockr.o demons.o\
- X dgame.o dinit.o dmain.o dso1.o dso2.o\
- X dso3.o dso4.o dso5.o dso6.o dso7.o\
- X dsub.o dverb1.o dverb2.o gdt.o lightp.o\
- X nobjs.o np.o np1.o np2.o np3.o nrooms.o objcts.o\
- X rooms.o rtim.o sobjs.o sverbs.o verbs.o villns.o
- X
- XPDPOBJS = cinit.o cio.o lex.o
- XLISTEN = listen.o
- XSPEAK = cspeak.o speak.o
- X
- Xvax: dungeon dtext.dat
- Xpdp: dungpdp speak listen dtext.dat
- X
- Xdungeon: $(OBJS)
- X f77 -s -o dungeon $(OBJS)
- X
- Xdungpdp: $(OBJS) $(PDPOBJS)
- X f77 -i -s -o dungpdp $(OBJS) $(PDPOBJS)
- X
- Xspeak: $(SPEAK)
- X f77 -i -s -o speak $(SPEAK)
- X
- Xspeak.o: speak.F
- X f77 $(FFLAGS) -DDDIR=$(DDIR) -c speak.F
- X
- Xlisten: $(LISTEN)
- X cc $(CFLAGS) -o listen $(LISTEN)
- X
- Xlisten.o: listen.c
- X cc $(CFLAGS) -DCINDEXFILE=$(DCDIR)/dindx.dat\" -c listen.c
- X
- Xdinit.o: dinit.F
- X f77 $(FFLAGS) -DDDIR=$(DDIR) $(WIZDEF) -c dinit.F
- X
- Xinstall-vax: vax
- X cp dungeon $(BIN)
- X -mkdir $(DDIR)
- X cp dindx.dat dtext.dat $(DDIR)
- X cp dungeon.6 $(MDIR)/dungeon.6
- X
- Xinstall-pdp: pdp
- X cp dungeon.sh $(BIN)
- X -mkdir $(DDIR)
- X cp dindx.dat dtext.dat rtext.dat dungpdp $(DDIR)
- X cp dungeon.6 $(MDIR)/dungeon.6
- X
- Xdtext.dat:
- X ./maketxt.sh
- X
- END_OF_Makefile
- if test 1818 -ne `wc -c <Makefile`; then
- echo shar: \"Makefile\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f PDP.doc -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"PDP.doc\"
- else
- echo shar: Extracting \"PDP.doc\" \(2922 characters\)
- sed "s/^X//" >PDP.doc <<'END_OF_PDP.doc'
- XThe implementation of dungeon on unix systems
- XRandy Dietrich 17 Nov 1981
- X
- XWhen we set out to get dungeon running on unix we figured
- Xit wouldn't be too big a problem. After all a fortran
- Xcompiler (F77) existed and with relatively little problem
- Xmanaged to get everything to compile.
- XThen the Zorkmids hit the volcano.
- XWe thought that a program which would run in 28k on an
- XRSX system would have fit just fine in 64k, especially
- Xwith seperate i & d. We did not realize just how hostile
- Xunix is to FORTRAN programs.
- XThe first link indicated about 130 k (text only) was needed
- Xfor the whole game (Ieeeeee). Recompiling with short (I2)
- Xintegers brought this down to about 100k. Throwing out
- Xthe game debug package (9k) and the save and restore code (3k)
- Xgot us to within 20k.
- XAt this point we discovered that the fortran library that
- Xwas being used was about 25k (A HA !!). If we could just
- Xeliminate that we would be in business. A great game with
- Xno I/O !! further work allowed us to write the I/O in C
- Xwith the bulk of the game using only standard input and output.
- XThe initialization and message printing were "moved out"
- Xinto seperate processes and the whole mess piped together.
- Xit is a real kludge but seems to work (mostly).
- X
- XThe Input process is called 'listen'. It first reads the init
- Xfile and shoves it in the pipe and then switches to pass
- Xkeyboard input to the main game. This keeps the main program
- Xfrom having to read anything but 'standard input'.
- X
- XThe output process is currently called 'speak'.
- Xthis process does the lookup in the file 'dtext.dat' and
- Xsends out the messages that give dungeon it's flavor. This
- Xprocess also passes clear text from the main program to
- Xallow the output of other messages for such things as the
- Xecho room, puzzle room, and score. These functions
- Xwere also 'moved out' so the main program would not have
- Xto access any disc files.
- X
- XThe main program is sandwitched between listen and speak.
- XIt really does the work of the game. I/O is handled
- Xthorugh C routines in 'cio.c'. this keeps any fortran
- XI/O from being used and calling in the whole #$%@ fortran
- Xlibrary.
- X
- XThe current lash-up does save or restore but not both.
- XIt is going to take a while to work in as we are out of room
- Xin the main program and will have to re-write something
- Xto make it all fit. I guess we will just have to play
- Xwithout being able to cheat for a while.
- X
- XRestores are done by initializing the game with a second argument
- X(some day the file name) of 'r'. This causes the init process
- Xto send a 'R' down down the pipe followed by the restore data.
- Xnormally the init process ends with a '?'. The trailing '?'
- Xwill follow the restore data.
- X
- XSaves are done from within the game. The game sends a 's'
- Xdown the pipe to signal the speak process to do a save opperation.
- XThe save data then goes down the pipe followed by 'e' to
- Xsignal the end of data. The save data is 'dungeon.sav'.
- END_OF_PDP.doc
- if test 2922 -ne `wc -c <PDP.doc`; then
- echo shar: \"PDP.doc\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f advers.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"advers.h\"
- else
- echo shar: Extracting \"advers.h\" \(217 characters\)
- sed "s/^X//" >advers.h <<'END_OF_advers.h'
- XC
- XC ADVENTURERS
- XC
- X COMMON /ADVS/ ALNT,AROOM(4),ASCORE(4),AVEHIC(4),
- X& AOBJ(4),AACTIO(4),ASTREN(4),AFLAG(4)
- X INTEGER EQA(4,7)
- X EQUIVALENCE (AROOM, EQA)
- XC
- X COMMON /AFLAGS/ ASTAG
- XC
- X COMMON /AINDEX/ PLAYER,AROBOT,AMASTR
- END_OF_advers.h
- if test 217 -ne `wc -c <advers.h`; then
- echo shar: \"advers.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f ballop.F -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"ballop.F\"
- else
- echo shar: Extracting \"ballop.F\" \(2153 characters\)
- sed "s/^X//" >ballop.F <<'END_OF_ballop.F'
- XC BALLOP- BALLOON FUNCTION
- XC
- XC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
- XC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
- XC WRITTEN BY R. M. SUPNIK
- XC
- XC DECLARATIONS
- XC
- X LOGICAL FUNCTION BALLOP(ARG)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL FINDXT,QEMPTY
- X#include "parser.h"
- X#include "gamestate.h"
- X#include "state.h"
- X#include "rooms.h"
- X#include "rflag.h"
- X#include "curxt.h"
- X#include "xpars.h"
- X#include "objects.h"
- X#include "oflags.h"
- X#include "oindex.h"
- X#include "clock.h"
- X
- X#include "verbs.h"
- X#include "flags.h"
- XC BALLOP, PAGE 2
- XC
- X BALLOP=.TRUE.
- XC !ASSUME WINS.
- X IF(ARG.NE.2) GO TO 200
- XC !READOUT?
- X IF(PRSA.NE.LOOKW) GO TO 10
- XC !ONLY PROCESS LOOK.
- X IF(BINFF.NE.0) GO TO 50
- XC !INFLATED?
- X CALL RSPEAK(543)
- XC !NO.
- X GO TO 100
- X50 CALL RSPSUB(544,ODESC2(BINFF))
- XC !YES.
- X100 IF(BTIEF.NE.0) CALL RSPEAK(545)
- XC !HOOKED?
- X RETURN
- XC
- X200 IF(ARG.NE.1) GO TO 500
- XC !READIN?
- X IF(PRSA.NE.WALKW) GO TO 300
- XC !WALK?
- X IF(FINDXT(PRSO,HERE)) GO TO 250
- XC !VALID EXIT?
- X CALL RSPEAK(546)
- XC !NO, JOKE.
- X RETURN
- XC
- X250 IF(BTIEF.EQ.0) GO TO 275
- XC !TIED UP?
- X CALL RSPEAK(547)
- XC !YES, JOKE.
- X RETURN
- XC
- X275 IF(XTYPE.NE.XNORM) GO TO 10
- XC !NORMAL EXIT?
- X IF(and(RFLAG(XROOM1),RMUNG).EQ.0) BLOC=XROOM1
- X10 BALLOP=.FALSE.
- X RETURN
- XC
- X300 IF((PRSA.NE.TAKEW).OR.(PRSO.NE.BINFF)) GO TO 350
- X CALL RSPSUB(548,ODESC2(BINFF))
- XC !RECEP CONT TOO HOT.
- X RETURN
- XC
- X350 IF((PRSA.NE.PUTW).OR.(PRSI.NE.RECEP).OR.QEMPTY(RECEP))
- X& GO TO 10
- X CALL RSPEAK(549)
- X RETURN
- XC
- X500 IF((PRSA.NE.UNBOAW).OR.(and(RFLAG(HERE),RLAND).EQ.0))
- X& GO TO 600
- X IF(BINFF.NE.0) CTICK(CEVBAL)=3
- XC !HE GOT OUT, START BALLOON.
- X GO TO 10
- XC
- X600 IF((PRSA.NE.BURNW).OR.(OCAN(PRSO).NE.RECEP)) GO TO 700
- X CALL RSPSUB(550,ODESC2(PRSO))
- XC !LIGHT FIRE IN RECEP.
- X CTICK(CEVBRN)=OSIZE(PRSO)*20
- X OFLAG1(PRSO)=or(OFLAG1(PRSO),
- X& and((ONBT+FLAMBT+LITEBT), not(TAKEBT+READBT)))
- X IF(BINFF.NE.0) RETURN
- X IF(.NOT.BLABF) CALL NEWSTA(BLABE,0,0,BALLO,0)
- X BLABF=.TRUE.
- X BINFF=PRSO
- X CTICK(CEVBAL)=3
- X CALL RSPEAK(551)
- X RETURN
- XC
- X700 IF((PRSA.EQ.UNBOAW).AND.(BINFF.NE.0).AND.
- X& (and(RFLAG(HERE),RLAND).NE.0))
- X& CTICK(CEVBAL)=3
- X GO TO 10
- XC
- X END
- END_OF_ballop.F
- if test 2153 -ne `wc -c <ballop.F`; then
- echo shar: \"ballop.F\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f cinit.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"cinit.c\"
- else
- echo shar: Extracting \"cinit.c\" \(940 characters\)
- sed "s/^X//" >cinit.c <<'END_OF_cinit.c'
- X#include <stdio.h>
- X
- X
- X/* read one integer from the open file */
- Xintrd_(valptr)
- X
- Xint *valptr;
- X{
- X scanf("%d",valptr);
- X while((getchar() != '\n'));
- X return;
- X}
- X
- X/* read an array from the open file */
- Xaryrd_(cntptr,aryptr)
- X
- Xint *cntptr,*aryptr[];
- X{
- X int i;
- X
- X for(i = *cntptr; i > 0;--i,++aryptr)
- X scanf("%d",aryptr);
- X while((getchar() != '\n'));
- X return;
- X}
- X
- X/* get a logical value */
- Xlogrd_(ptr)
- Xint *ptr;
- X{
- Xstatic char byte;
- X
- X *ptr = 0;
- X while((byte = getchar()) != '\n'){
- X if ((byte == 'T') || (byte == 't'))
- X *ptr = 1;
- X }
- X return;
- X}
- X
- X
- X/* wait for end of init flag */
- Xinitnd_()
- X{
- X static int chr;
- X
- X while ((chr = getchar()) != '?'){ /* wait for end flag */
- X if (chr == 'R') /* check for restore flag */
- X rstrgm_(); /* call restore routine */
- X }
- X return;
- X}
- X
- X/* write an array to the open pipe */
- Xarywt_(cntptr,aryptr)
- X
- Xint *cntptr,*aryptr[];
- X{
- X static int i;
- X
- X for(i = *cntptr; i > 0;--i,++aryptr)
- X printf("%d\n",*aryptr);
- X return;
- X}
- X
- END_OF_cinit.c
- if test 940 -ne `wc -c <cinit.c`; then
- echo shar: \"cinit.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f cio.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"cio.c\"
- else
- echo shar: Extracting \"cio.c\" \(2551 characters\)
- sed "s/^X//" >cio.c <<'END_OF_cio.c'
- X/* these are c routines to handle the pdp dungeon i/o */
- X#include <stdio.h>
- X
- X/* send arguments to message printing process */
- Xrspsb3_(arg1,arg2,arg3)
- X
- Xint *arg1,*arg2,*arg3;
- X{
- X printf("n%d %d %d\n",*arg1,*arg2,*arg3);
- X fflush(stdout);
- X return;
- X}
- X
- X/* print for puzzle room */
- Xpuzout_(p)
- X
- Xchar *p;
- X{
- X
- Xprintf(" |%c%c %c%c %c%c|\n",p[0],p[0],p[1],p[1],p[2],p[2]);
- Xprintf(" WEST |%c%c .. %c%c| EAST\n",p[3],p[3],p[4],p[4]);
- Xprintf(" |%c%c %c%c %c%c|\n",p[5],p[5],p[6],p[6],p[7],p[7]);
- Xfflush(stdout);
- Xreturn;
- X}
- X
- X/* output general string (echo room) */
- Xoutstr_(ptr,len)
- X
- Xint *len;
- Xchar *ptr[];
- X{
- X printf("%.*s\n",*len,ptr);
- X fflush(stdout);
- X return;
- X}
- X
- X
- X/* print a prompt */
- Xprompt_()
- X{
- X printf(" > ~");
- X fflush(stdout);
- X return;
- X}
- X
- X/* terminate the game */
- Xexit_()
- X{
- X fprintf(stderr,"The game is over\n");
- X exit(0);
- X}
- X
- X/* read a character */
- Xrdchr_(cptr)
- X
- Xchar *cptr;
- X{
- Xstatic int ch;
- X
- X if((ch = getchar()) == EOF){
- X fprintf(stderr,"EOF on input\n");
- X exit_();
- X }
- X else *cptr = ch;
- X return;
- X}
- X
- X/* read a line from std input */
- Xrdlin_(sptr,cntptr)
- X
- Xint *cntptr;
- Xchar *sptr;
- X{
- Xstatic int chr;
- X *cntptr = 0;
- X while ((chr = getchar()) != EOF){
- X if((chr >= 97) && (chr <= 122)) /* convert to uc */
- X chr -= 32;
- X if (chr == 10 ){ /* quit if newline */
- X *sptr++ = '\0';
- X return;
- X }
- X if ((chr == 32) && (*cntptr == 0)) /* rm lead blank */
- X continue;
- X if (*cntptr >= 78)
- X continue;
- X *sptr++ = chr;
- X (*cntptr)++;
- X }
- X fprintf(stderr,"EOF on input\n");
- X exit_();
- X}
- X
- X/* print cure time */
- Xcured_(time)
- X
- Xint *time;
- X{
- X printf(" You will be cured in %d moves\n",*time);
- X fflush(stdout);
- X return;
- X}
- X
- X/* print the score */
- Xpscore_(score,max,moves)
- X
- Xint *score, *max, *moves;
- X{
- Xprintf(" Your current score is %d out of %d points in %d moves.\n",*score, *max, *moves);
- X fflush(stdout);
- X return;
- X}
- X
- X/* BUG-- REPORT FATAL SYSTEM ERROR
- XC
- XC CALLED BY--
- XC
- XC CALL BUG(NO,PAR)
- XC
- XC note: return if DBGFLG set is not implemented
- XC*/
- Xbug_(a,b)
- X
- Xint *a,*b;
- X{
- X fprintf(stderr,"Program error %d ; Parameter %d\n",*a,*b);
- X exit(0);
- X}
- X
- X
- X/* send restore message */
- Xrestor_()
- X{
- X printf(" Restore by starting with 'dungeon r'\n");
- X return;
- X}
- X
- X/* password output */
- Xvoice_(sp1, sp2)
- X
- Xchar *sp1, *sp2;
- X{
- X printf(" A Hollow voice replies: %6.6s %6.6s\n", sp1, sp2);
- X return;
- X}
- X
- X/* print version */
- Xprvers_(v1, v2, v3)
- X
- Xint *v1, *v2;
- Xchar *v3;
- X{
- X printf(" V%1d.%2d%c\n", *v1, *v2, *v3);
- X return;
- X}
- X
- X/* dummy stub for game debugger */
- Xnogdt_()
- X{
- X /* debugger deleted to save room */
- X printf(" Sorry, no debugger available in this version.\n");
- X return;
- X}
- END_OF_cio.c
- if test 2551 -ne `wc -c <cio.c`; then
- echo shar: \"cio.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f cspeak.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"cspeak.c\"
- else
- echo shar: Extracting \"cspeak.c\" \(1188 characters\)
- sed "s/^X//" >cspeak.c <<'END_OF_cspeak.c'
- X#include <stdio.h>
- X
- X/* routine to sort out input stream */
- X/* first character determines destination of the following data
- X n - get arguments for 'rspeak'
- X s - put data on dungeon save file until 'e' is received
- X else - pass text to screen */
- X
- Xinprd_(pa,pb,pc)
- X
- Xint *pa, *pb, *pc;
- X{
- Xint chr;
- X
- X (*pa)=(*pb)=(*pc)=0;
- X
- X while((chr = getchar()) != EOF) {
- X if (chr == '\n')
- X continue;
- X switch (chr) {
- X
- X case 'n': /* get args for rspeak */
- X if (scanf("%d%d%d",pa,pb,pc) > 0)
- X return;
- X else
- X printf("Speak input error\n");
- X break;
- X
- X case 's': /* send save data to file */
- X wrtsave();
- X break;
- X
- X default:
- X putchar(chr);
- X break;
- X
- X }
- X /* send text to screen */
- X while((chr = getchar()) != EOF){
- X if (chr == '~')
- X break;
- X putchar(chr);
- X if (chr == '\n')
- X break;
- X }
- X }
- X
- X /* terminate process */
- X printf("Goodbye ... GASP\n");
- X exit(0);
- X}
- X
- X/* write a save file */
- X
- Xwrtsave()
- X{
- X FILE *savptr, *fopen();
- X char chr;
- X
- X savptr = fopen("dungeon.sav","w");
- X
- X while ((chr = getchar()) != EOF) {
- X if (chr == 'e') { /* check for end char */
- X fclose(savptr);
- X return;
- X }
- X putc(chr,savptr);
- X }
- X printf("EOF during save\n");
- X exit(0);
- X}
- END_OF_cspeak.c
- if test 1188 -ne `wc -c <cspeak.c`; then
- echo shar: \"cspeak.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f curxt.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"curxt.h\"
- else
- echo shar: Extracting \"curxt.h\" \(94 characters\)
- sed "s/^X//" >curxt.h <<'END_OF_curxt.h'
- XC
- XC CURRENT EXITS
- XC
- X COMMON /CURXT/ XTYPE,XROOM1,XSTRNG,XACTIO,XOBJ
- X EQUIVALENCE (XFLAG,XOBJ)
- END_OF_curxt.h
- if test 94 -ne `wc -c <curxt.h`; then
- echo shar: \"curxt.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f debug.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"debug.h\"
- else
- echo shar: Extracting \"debug.h\" \(80 characters\)
- sed "s/^X//" >debug.h <<'END_OF_debug.h'
- XC
- X COMMON /DEBUG/ DBGFLG,PRSFLG,GDTFLG
- X#ifdef debug
- X LOGICAL DFLAG
- X#endif debug
- END_OF_debug.h
- if test 80 -ne `wc -c <debug.h`; then
- echo shar: \"debug.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f decode.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"decode.c\"
- else
- echo shar: Extracting \"decode.c\" \(462 characters\)
- sed "s/^X//" >decode.c <<'END_OF_decode.c'
- X/*
- X * Decode dtext.dat file into readable ASCII.
- X * John Gilmore (hoptoad!gnu), December 1986
- X */
- X#include <stdio.h>
- X#define STRLEN 74
- Xchar string[STRLEN+1];
- Xint recno = 0;
- X
- Xmain() {
- X unsigned char byte, byte2;
- X int i;
- X
- X while (1) {
- X recno++;
- X byte = getchar();
- X byte2 = getchar();
- X if (1 != fread (string, STRLEN, 1, stdin)) exit(0);
- X for (i = 1; i <= STRLEN; i++)
- X string[i-1] ^= (recno&31)+i;
- X printf("%2x%02x %s\n",
- X byte2, byte, string);
- X }
- X}
- X
- END_OF_decode.c
- if test 462 -ne `wc -c <decode.c`; then
- echo shar: \"decode.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f dso1.F -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"dso1.F\"
- else
- echo shar: Extracting \"dso1.F\" \(2806 characters\)
- sed "s/^X//" >dso1.F <<'END_OF_dso1.F'
- XC PRINCR- PRINT CONTENTS OF ROOM
- XC
- XC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
- XC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
- XC WRITTEN BY R. M. SUPNIK
- XC
- XC DECLARATIONS
- XC
- X SUBROUTINE PRINCR(FULL,RM)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL QEMPTY,QHERE,FULL
- X#include "gamestate.h"
- X#include "rooms.h"
- X#include "rflag.h"
- XC
- X#include "objects.h"
- X#include "oflags.h"
- X#include "oindex.h"
- X#include "advers.h"
- X#include "flags.h"
- XC PRINCR, PAGE 2
- XC
- X J=329
- XC !ASSUME SUPERBRIEF FORMAT.
- X DO 500 I=1,OLNT
- XC !LOOP ON OBJECTS
- X IF(.NOT.QHERE(I,RM).OR.(and(OFLAG1(I),(VISIBT+NDSCBT)).NE.
- X& VISIBT).OR.(I.EQ.AVEHIC(WINNER))) GO TO 500
- X IF(.NOT.FULL.AND.(SUPERF.OR.(BRIEFF.AND.
- X& (and(RFLAG(HERE),RSEEN).NE.0)))) GO TO 200
- XC
- XC DO LONG DESCRIPTION OF OBJECT.
- XC
- X K=ODESCO(I)
- XC !GET UNTOUCHED.
- X IF((K.EQ.0).OR.(and(OFLAG2(I),TCHBT).NE.0)) K=ODESC1(I)
- X CALL RSPEAK(K)
- XC !DESCRIBE.
- X GO TO 500
- XC DO SHORT DESCRIPTION OF OBJECT.
- XC
- X200 CALL RSPSUB(J,ODESC2(I))
- XC !YOU CAN SEE IT.
- X J=502
- XC
- X500 CONTINUE
- XC
- XC NOW LOOP TO PRINT CONTENTS OF OBJECTS IN ROOM.
- XC
- X DO 1000 I=1,OLNT
- XC !LOOP ON OBJECTS.
- X IF(.NOT.QHERE(I,RM).OR.(and(OFLAG1(I),(VISIBT+NDSCBT)).NE.
- X& VISIBT)) GO TO 1000
- X IF(and(OFLAG2(I),ACTRBT).NE.0) CALL INVENT(OACTOR(I))
- X IF(((and(OFLAG1(I),TRANBT).EQ.0)
- X& .AND.(and(OFLAG2(I),OPENBT).EQ.0))
- X& .OR.QEMPTY(I)) GO TO 1000
- XC
- XC OBJECT IS NOT EMPTY AND IS OPEN OR TRANSPARENT.
- XC
- X J=573
- X IF(I.NE.TCASE) GO TO 600
- XC !TROPHY CASE?
- X J=574
- X IF((BRIEFF.OR.SUPERF).AND. .NOT.FULL) GO TO 1000
- X600 CALL PRINCO(I,J)
- XC !PRINT CONTENTS.
- XC
- X1000 CONTINUE
- X RETURN
- XC
- X END
- XC INVENT- PRINT CONTENTS OF ADVENTURER
- XC
- XC DECLARATIONS
- XC
- X SUBROUTINE INVENT(ADV)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL QEMPTY
- X#include "gamestate.h"
- X#include "objects.h"
- X#include "oflags.h"
- XC
- X#include "advers.h"
- XC INVENT, PAGE 2
- XC
- X I=575
- XC !FIRST LINE.
- X IF(ADV.NE.PLAYER) I=576
- XC !IF NOT ME.
- X DO 10 J=1,OLNT
- XC !LOOP
- X IF((OADV(J).NE.ADV).OR.(and(OFLAG1(J),VISIBT).EQ.0))
- X& GO TO 10
- X CALL RSPSUB(I,ODESC2(AOBJ(ADV)))
- X I=0
- X CALL RSPSUB(502,ODESC2(J))
- X10 CONTINUE
- XC
- X IF(I.EQ.0) GO TO 25
- XC !ANY OBJECTS?
- X IF(ADV.EQ.PLAYER) CALL RSPEAK(578)
- XC !NO, TELL HIM.
- X RETURN
- XC
- X25 DO 100 J=1,OLNT
- XC !LOOP.
- X IF((OADV(J).NE.ADV).OR.(and(OFLAG1(J),VISIBT).EQ.0).OR.
- X& ((and(OFLAG1(J),TRANBT).EQ.0).AND.
- X& (and(OFLAG2(J),OPENBT).EQ.0))) GO TO 100
- X IF(.NOT.QEMPTY(J)) CALL PRINCO(J,573)
- XC !IF NOT EMPTY, LIST.
- X100 CONTINUE
- X RETURN
- XC
- X END
- XC PRINCO- PRINT CONTENTS OF OBJECT
- XC
- XC DECLARATIONS
- XC
- X SUBROUTINE PRINCO(OBJ,DESC)
- X IMPLICIT INTEGER(A-Z)
- X#include "objects.h"
- XC
- X CALL RSPSUB(DESC,ODESC2(OBJ))
- XC !PRINT HEADER.
- X DO 100 I=1,OLNT
- XC !LOOP THRU.
- X IF(OCAN(I).EQ.OBJ) CALL RSPSUB(502,ODESC2(I))
- X100 CONTINUE
- X RETURN
- XC
- X END
- END_OF_dso1.F
- if test 2806 -ne `wc -c <dso1.F`; then
- echo shar: \"dso1.F\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f dso3.F -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"dso3.F\"
- else
- echo shar: Extracting \"dso3.F\" \(2686 characters\)
- sed "s/^X//" >dso3.F <<'END_OF_dso3.F'
- XC FINDXT- FIND EXIT FROM ROOM
- XC
- XC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
- XC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
- XC WRITTEN BY R. M. SUPNIK
- XC
- XC DECLARATIONS
- XC
- X LOGICAL FUNCTION FINDXT(DIR,RM)
- X IMPLICIT INTEGER (A-Z)
- X#include "rooms.h"
- X#include "exits.h"
- X#include "curxt.h"
- X#include "xpars.h"
- XC
- X FINDXT=.TRUE.
- XC !ASSUME WINS.
- X XI=REXIT(RM)
- XC !FIND FIRST ENTRY.
- X IF(XI.EQ.0) GO TO 1000
- XC !NO EXITS?
- XC
- X100 I=TRAVEL(XI)
- XC !GET ENTRY.
- X XROOM1=and(I,XRMASK)
- X XTYPE=and((and(I,not(XLFLAG))/XFSHFT),XFMASK)+1
- X GO TO (110,120,130,130),XTYPE
- XC !BRANCH ON ENTRY.
- X CALL BUG(10,XTYPE)
- XC
- X130 XOBJ=and(TRAVEL(XI+2),XRMASK)
- X XACTIO=TRAVEL(XI+2)/XASHFT
- X120 XSTRNG=TRAVEL(XI+1)
- XC !DOOR/CEXIT/NEXIT - STRING.
- X110 XI=XI+XELNT(XTYPE)
- XC !ADVANCE TO NEXT ENTRY.
- X IF(and(I,XDMASK).EQ.DIR) RETURN
- X IF(and(I,XLFLAG).EQ.0) GO TO 100
- X1000 FINDXT=.FALSE.
- XC !YES, LOSE.
- X RETURN
- X END
- XC FWIM- FIND WHAT I MEAN
- XC
- XC DECLARATIONS
- XC
- X INTEGER FUNCTION FWIM(F1,F2,RM,CON,ADV,NOCARE)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL NOCARE
- X#include "objects.h"
- X#include "oflags.h"
- XC
- X FWIM=0
- XC !ASSUME NOTHING.
- X DO 1000 I=1,OLNT
- XC !LOOP
- X IF(((RM.EQ.0).OR.(OROOM(I).NE.RM)) .AND.
- X& ((ADV.EQ.0).OR.(OADV(I).NE.ADV)) .AND.
- X& ((CON.EQ.0).OR.(OCAN(I).NE.CON)))
- X& GO TO 1000
- XC
- XC OBJECT IS ON LIST... IS IT A MATCH?
- XC
- X IF(and(OFLAG1(I),VISIBT).EQ.0) GO TO 1000
- X IF(and(not(NOCARE),(and(OFLAG1(I),TAKEBT).EQ.0)) .OR.
- X& ((and(OFLAG1(I),F1).EQ.0).AND.
- X& (and(OFLAG2(I),F2).EQ.0))) GO TO 500
- X IF(FWIM.EQ.0) GO TO 400
- XC !ALREADY GOT SOMETHING?
- X FWIM=-FWIM
- XC !YES, AMBIGUOUS.
- X RETURN
- XC
- X400 FWIM=I
- XC !NOTE MATCH.
- XC
- XC DOES OBJECT CONTAIN A MATCH?
- XC
- X500 IF(and(OFLAG2(I),OPENBT).EQ.0) GO TO 1000
- X DO 700 J=1,OLNT
- XC !NO, SEARCH CONTENTS.
- X IF((OCAN(J).NE.I).OR.(and(OFLAG1(J),VISIBT).EQ.0) .OR.
- X& ((and(OFLAG1(J),F1).EQ.0).AND.
- X& (and(OFLAG2(J),F2).EQ.0))) GO TO 700
- X IF(FWIM.EQ.0) GO TO 600
- X FWIM=-FWIM
- X RETURN
- XC
- X600 FWIM=J
- X700 CONTINUE
- X1000 CONTINUE
- X RETURN
- X END
- XC YESNO- OBTAIN YES/NO ANSWER
- XC
- XC CALLED BY-
- XC
- XC YES-IS-TRUE=YESNO(QUESTION,YES-STRING,NO-STRING)
- XC
- X LOGICAL FUNCTION YESNO(Q,Y,N)
- X IMPLICIT INTEGER(A-Z)
- X COMMON /CHAN/ INPCH,OUTCH,DBCH
- X CHARACTER ANS
- XC
- X100 CALL RSPEAK(Q)
- XC !ASK
- X#ifdef PDP
- X call rdchr(ANS)
- X#else
- X READ(INPCH,110) ANS
- X#endif PDP
- XC !GET ANSWER
- X110 FORMAT(A1)
- X IF((ANS.EQ.'Y').OR.(ANS.EQ.'y')) GO TO 200
- X IF((ANS.EQ.'N').OR.(ANS.EQ.'n')) GO TO 300
- X CALL RSPEAK(6)
- XC !SCOLD.
- X GO TO 100
- XC
- X200 YESNO=.TRUE.
- XC !YES,
- X CALL RSPEAK(Y)
- XC !OUT WITH IT.
- X RETURN
- XC
- X300 YESNO=.FALSE.
- XC !NO,
- X CALL RSPEAK(N)
- XC !LIKEWISE.
- X RETURN
- XC
- X END
- END_OF_dso3.F
- if test 2686 -ne `wc -c <dso3.F`; then
- echo shar: \"dso3.F\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f dso4.F -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"dso4.F\"
- else
- echo shar: Extracting \"dso4.F\" \(2615 characters\)
- sed "s/^X//" >dso4.F <<'END_OF_dso4.F'
- XC ROBADV-- STEAL WINNER'S VALUABLES
- XC
- XC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
- XC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
- XC WRITTEN BY R. M. SUPNIK
- XC
- XC DECLARATIONS
- XC
- X INTEGER FUNCTION ROBADV(ADV,NR,NC,NA)
- X IMPLICIT INTEGER (A-Z)
- X#include "objects.h"
- X#include "oflags.h"
- XC
- X ROBADV=0
- XC !COUNT OBJECTS
- X DO 100 I=1,OLNT
- X IF((OADV(I).NE.ADV).OR.(OTVAL(I).LE.0).OR.
- X& (and(OFLAG2(I),SCRDBT).NE.0)) GO TO 100
- X CALL NEWSTA(I,0,NR,NC,NA)
- XC !STEAL OBJECT
- X ROBADV=ROBADV+1
- X100 CONTINUE
- X RETURN
- X END
- XC ROBRM-- STEAL ROOM VALUABLES
- XC
- XC DECLARATIONS
- XC
- X INTEGER FUNCTION ROBRM(RM,PR,NR,NC,NA)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL PROB,QHERE
- X#include "objects.h"
- X#include "oflags.h"
- XC
- X ROBRM=0
- XC !COUNT OBJECTS
- X DO 100 I=1,OLNT
- XC !LOOP ON OBJECTS.
- X IF(.NOT. QHERE(I,RM)) GO TO 100
- X IF((OTVAL(I).LE.0).OR.(and(OFLAG2(I),SCRDBT).NE.0).OR.
- X& (and(OFLAG1(I),VISIBT).EQ.0).OR.(.NOT.PROB(PR,PR)))
- X& GO TO 50
- X CALL NEWSTA(I,0,NR,NC,NA)
- X ROBRM=ROBRM+1
- X OFLAG2(I)=or(OFLAG2(I),TCHBT)
- X GO TO 100
- X50 IF(and(OFLAG2(I),ACTRBT).NE.0)
- X& ROBRM=ROBRM+ROBADV(OACTOR(I),NR,NC,NA)
- X100 CONTINUE
- X RETURN
- X END
- XC WINNIN-- SEE IF VILLAIN IS WINNING
- XC
- XC DECLARATIONS
- XC
- X LOGICAL FUNCTION WINNIN(VL,HR)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL PROB
- X#include "objects.h"
- XC
- X VS=OCAPAC(VL)
- XC !VILLAIN STRENGTH
- X PS=VS-FIGHTS(HR,.TRUE.)
- XC !HIS MARGIN OVER HERO
- X WINNIN=PROB(90,100)
- X IF(PS.GT.3) RETURN
- XC !+3... 90% WINNING
- X WINNIN=PROB(75,85)
- X IF(PS.GT.0) RETURN
- XC !>0... 75% WINNING
- X WINNIN=PROB(50,30)
- X IF(PS.EQ.0) RETURN
- XC !=0... 50% WINNING
- X WINNIN=PROB(25,25)
- X IF(VS.GT.1) RETURN
- XC !ANY VILLAIN STRENGTH.
- X WINNIN=PROB(10,0)
- X RETURN
- X END
- XC FIGHTS-- COMPUTE FIGHT STRENGTH
- XC
- XC DECLARATIONS
- XC
- X INTEGER FUNCTION FIGHTS(H,FLG)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL FLG
- XC
- XC GAME STATE
- XC
- X#include "state.h"
- X#include "advers.h"
- XC
- XC FUNCTIONS AND DATA
- XC
- X DATA SMAX/7/,SMIN/2/
- XC
- X FIGHTS=SMIN+((((SMAX-SMIN)*ASCORE(H))+(MXSCOR/2))/MXSCOR)
- X IF(FLG) FIGHTS=FIGHTS+ASTREN(H)
- X RETURN
- X END
- XC VILSTR- COMPUTE VILLAIN STRENGTH
- XC
- XC DECLARATIONS
- XC
- X INTEGER FUNCTION VILSTR(V)
- X IMPLICIT INTEGER (A-Z)
- X#include "parser.h"
- X#include "objects.h"
- X#include "oflags.h"
- X#include "oindex.h"
- X#include "villians.h"
- X#include "flags.h"
- XC VILSTR, PAGE 2
- XC
- X VILSTR=OCAPAC(V)
- X IF(VILSTR.LE.0) RETURN
- X IF((V.NE.THIEF).OR..NOT.THFENF) GO TO 100
- X THFENF=.FALSE.
- XC !THIEF UNENGROSSED.
- X VILSTR=MIN0(VILSTR,2)
- XC !NO BETTER THAN 2.
- XC
- X100 DO 200 I=1,VLNT
- XC !SEE IF BEST WEAPON.
- X IF((VILLNS(I).EQ.V).AND.(PRSI.EQ.VBEST(I)))
- X& VILSTR=MAX0(1,VILSTR-1)
- X200 CONTINUE
- X RETURN
- X END
- END_OF_dso4.F
- if test 2615 -ne `wc -c <dso4.F`; then
- echo shar: \"dso4.F\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f dso5.F -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"dso5.F\"
- else
- echo shar: Extracting \"dso5.F\" \(2654 characters\)
- sed "s/^X//" >dso5.F <<'END_OF_dso5.F'
- XC
- XC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
- XC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
- XC WRITTEN BY R. M. SUPNIK
- XC
- X#ifndef PDP /* replaced by C function for pdp */
- XC GTTIME-- GET TOTAL TIME PLAYED
- XC
- XC DECLARATIONS
- XC
- X SUBROUTINE GTTIME(T)
- X IMPLICIT INTEGER(A-Z)
- XC
- X COMMON /TIME/ PLTIME,SHOUR,SMIN,SSEC
- XC
- X CALL ITIME(H,M,S)
- X T=((H*60)+M)-((SHOUR*60)+SMIN)
- X IF(T.LT.0) T=T+1440
- X T=T+PLTIME
- X RETURN
- X END
- X#endif PDP
- XC OPNCLS-- PROCESS OPEN/CLOSE FOR DOORS
- XC
- XC DECLARATIONS
- XC
- X LOGICAL FUNCTION OPNCLS(OBJ,SO,SC)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL QOPEN
- X#include "parser.h"
- X#include "objects.h"
- X#include "oflags.h"
- X#include "verbs.h"
- XC
- XC FUNCTIONS AND DATA
- XC
- X QOPEN(O)=and(OFLAG2(O),OPENBT).NE.0
- XC
- X OPNCLS=.TRUE.
- XC !ASSUME WINS.
- X IF(PRSA.EQ.CLOSEW) GO TO 100
- XC !CLOSE?
- X IF(PRSA.EQ.OPENW) GO TO 50
- XC !OPEN?
- X OPNCLS=.FALSE.
- XC !LOSE
- X RETURN
- XC
- X50 IF(QOPEN(OBJ)) GO TO 200
- XC !OPEN... IS IT?
- X CALL RSPEAK(SO)
- X OFLAG2(OBJ)=or(OFLAG2(OBJ),OPENBT)
- X RETURN
- XC
- X100 IF(.NOT.QOPEN(OBJ)) GO TO 200
- XC !CLOSE... IS IT?
- X CALL RSPEAK(SC)
- X OFLAG2(OBJ)=and(OFLAG2(OBJ),not(OPENBT))
- X RETURN
- XC
- X200 CALL RSPEAK(125+RND(3))
- XC !DUMMY.
- X RETURN
- X END
- XC LIT-- IS ROOM LIT?
- XC
- XC DECLARATIONS
- XC
- X LOGICAL FUNCTION LIT(RM)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL QHERE
- X#include "rooms.h"
- X#include "rflag.h"
- X#include "objects.h"
- X#include "oflags.h"
- X#include "advers.h"
- XC
- X LIT=.TRUE.
- XC !ASSUME WINS
- X IF(and(RFLAG(RM),RLIGHT).NE.0) RETURN
- XC
- X DO 1000 I=1,OLNT
- XC !LOOK FOR LIT OBJ
- X IF(QHERE(I,RM)) GO TO 100
- XC !IN ROOM?
- X OA=OADV(I)
- XC !NO
- X IF(OA.LE.0) GO TO 1000
- XC !ON ADV?
- X IF(AROOM(OA).NE.RM) GO TO 1000
- XC !ADV IN ROOM?
- XC
- XC OBJ IN ROOM OR ON ADV IN ROOM
- XC
- X100 IF(and(OFLAG1(I),ONBT).NE.0) RETURN
- X IF((and(OFLAG1(I),VISIBT).EQ.0).OR.
- X& ((and(OFLAG1(I),TRANBT).EQ.0).AND.
- X& (and(OFLAG2(I),OPENBT).EQ.0))) GO TO 1000
- XC
- XC OBJ IS VISIBLE AND OPEN OR TRANSPARENT
- XC
- X DO 500 J=1,OLNT
- X IF((OCAN(J).EQ.I).AND.(and(OFLAG1(J),ONBT).NE.0))
- X& RETURN
- X500 CONTINUE
- X1000 CONTINUE
- X LIT=.FALSE.
- X RETURN
- X END
- XC WEIGHT- RETURNS SUM OF WEIGHT OF QUALIFYING OBJECTS
- XC
- XC DECLARATIONS
- XC
- X INTEGER FUNCTION WEIGHT(RM,CN,AD)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL QHERE
- X#include "objects.h"
- XC
- X WEIGHT=0
- X DO 100 I=1,OLNT
- XC !OMIT BIG FIXED ITEMS.
- X IF(OSIZE(I).GE.10000) GO TO 100
- XC !IF FIXED, FORGET IT.
- X IF((QHERE(I,RM).AND.(RM.NE.0)).OR.
- X& ((OADV(I).EQ.AD).AND.(AD.NE.0))) GO TO 50
- X J=I
- XC !SEE IF CONTAINED.
- X25 J=OCAN(J)
- XC !GET NEXT LEVEL UP.
- X IF(J.EQ.0) GO TO 100
- XC !END OF LIST?
- X IF(J.NE.CN) GO TO 25
- X50 WEIGHT=WEIGHT+OSIZE(I)
- X100 CONTINUE
- X RETURN
- X END
- END_OF_dso5.F
- if test 2654 -ne `wc -c <dso5.F`; then
- echo shar: \"dso5.F\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f dso6.F -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"dso6.F\"
- else
- echo shar: Extracting \"dso6.F\" \(2359 characters\)
- sed "s/^X//" >dso6.F <<'END_OF_dso6.F'
- XC GHERE-- IS GLOBAL ACTUALLY IN THIS ROOM?
- XC
- XC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
- XC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
- XC WRITTEN BY R. M. SUPNIK
- XC
- XC DECLARATIONS
- XC
- X LOGICAL FUNCTION GHERE(OBJ,RM)
- X IMPLICIT INTEGER(A-Z)
- X#include "rooms.h"
- X#include "rflag.h"
- X#include "rindex.h"
- XC
- X COMMON /STAR/ MBASE,STRBIT
- XC GHERE, PAGE 2
- XC
- X GHERE=.TRUE.
- XC !ASSUME WINS.
- X GO TO (1000,1000,1000,1000,1000,1000,
- X& 1000,1000,1000,1000,1000,
- X& 2000,3000,4000,5000,5000,5000,6000,
- X& 7000,8000,9000,9100,8000,10000,11000),OBJ-STRBIT
- X CALL BUG(60,OBJ)
- XC
- XC 1000-- STARS ARE ALWAYS HERE
- XC
- X1000 RETURN
- XC
- XC 2000-- BIRD
- XC
- X2000 GHERE=((RM.GE.FORE1).AND.(RM.LT.CLEAR)).OR.(RM.EQ.MTREE)
- X RETURN
- XC
- XC 3000-- TREE
- XC
- X3000 GHERE=((RM.GE.FORE1).AND.(RM.LT.CLEAR)).AND.(RM.NE.FORE3)
- X RETURN
- XC
- XC 4000-- NORTH WALL
- XC
- X4000 GHERE=((RM.GE.BKVW).AND.(RM.LE.BKBOX)).OR.(RM.EQ.CPUZZ)
- X RETURN
- XC
- XC 5000-- EAST, SOUTH, WEST WALLS
- XC
- X5000 GHERE=((RM.GE.BKVW).AND.(RM.LT.BKBOX)).OR.(RM.EQ.CPUZZ)
- X RETURN
- XC
- XC 6000-- GLOBAL WATER
- XC
- X6000 GHERE=and(RFLAG(RM),(RWATER+RFILL)).NE.0
- X RETURN
- XC
- XC 7000-- GLOBAL GUARDIANS
- XC
- X7000 GHERE=((RM.GE.MRC).AND.(RM.LE.MRD)).OR.
- X& ((RM.GE.MRCE).AND.(RM.LE.MRDW)).OR.(RM.EQ.INMIR)
- X RETURN
- XC
- XC 8000-- ROSE/CHANNEL
- XC
- X8000 GHERE=((RM.GE.MRA).AND.(RM.LE.MRD)).OR.(RM.EQ.INMIR)
- X RETURN
- XC
- XC 9000-- MIRROR
- XC 9100 PANEL
- XC
- X9100 IF(RM.EQ.FDOOR) RETURN
- XC !PANEL AT FDOOR.
- X9000 GHERE=((RM.GE.MRA).AND.(RM.LE.MRC)).OR.
- X& ((RM.GE.MRAE).AND.(RM.LE.MRCW))
- X RETURN
- XC
- XC 10000-- MASTER
- XC
- X10000 GHERE=(RM.EQ.FDOOR).OR.(RM.EQ.NCORR).OR.(RM.EQ.PARAP).OR.
- X& (RM.EQ.CELL)
- X RETURN
- XC
- XC 11000-- LADDER
- XC
- X11000 GHERE=(RM.EQ.CPUZZ)
- X RETURN
- XC
- X END
- XC MRHERE-- IS MIRROR HERE?
- XC
- XC DECLARATIONS
- XC
- X INTEGER FUNCTION MRHERE(RM)
- X IMPLICIT INTEGER(A-Z)
- XC
- XC ROOMS
- X#include "rindex.h"
- X#include "flags.h"
- XC MRHERE, PAGE 2
- XC
- X IF((RM.LT.MRAE).OR.(RM.GT.MRDW)) GO TO 100
- XC
- XC RM IS AN E-W ROOM, MIRROR MUST BE N-S (MDIR= 0 OR 180)
- XC
- X MRHERE=1
- XC !ASSUME MIRROR 1 HERE.
- X IF(MOD(RM-MRAE,2).EQ.(MDIR/180)) MRHERE=2
- X RETURN
- XC
- XC RM IS NORTH OR SOUTH OF MIRROR. IF MIRROR IS N-S OR NOT
- XC WITHIN ONE ROOM OF RM, LOSE.
- XC
- X100 MRHERE=0
- X IF((IABS(MLOC-RM).NE.1).OR.(MOD(MDIR,180).EQ.0)) RETURN
- XC
- XC RM IS WITHIN ONE OF MLOC, AND MDIR IS E-W
- XC
- X MRHERE=1
- X IF(((RM.LT.MLOC).AND.(MDIR.LT.180)).OR.
- X& ((RM.GT.MLOC).AND.(MDIR.GT.180))) MRHERE=2
- X RETURN
- X END
- END_OF_dso6.F
- if test 2359 -ne `wc -c <dso6.F`; then
- echo shar: \"dso6.F\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f dso7.F -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"dso7.F\"
- else
- echo shar: Extracting \"dso7.F\" \(2920 characters\)
- sed "s/^X//" >dso7.F <<'END_OF_dso7.F'
- XC ENCRYP-- ENCRYPT PASSWORD
- XC
- XC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
- XC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
- XC WRITTEN BY R. M. SUPNIK
- XC
- XC DECLARATIONS
- XC
- X SUBROUTINE ENCRYP(INW,OUTW)
- X IMPLICIT INTEGER(A-Z)
- X CHARACTER INW(6),OUTW(6)
- X CHARACTER KEYW(6),UKEYW(6)
- X INTEGER UINW(6)
- X DATA KEYW/'E','C','O','R','M','S'/
- XC
- X UINWS=0
- XC !UNBIASED INW SUM.
- X UKEYWS=0
- XC !UNBIASED KEYW SUM.
- X J=1
- XC !POINTER IN KEYWORD.
- X DO 100 I=1,6
- XC !UNBIAS, COMPUTE SUMS.
- X UKEYW(I)=char(ichar(KEYW(I))-64)
- X IF(INW(J).LE.char(64)) J=1
- X UINW(I)=ichar(ichar(INW(J))-64)
- X UKEYWS=UKEYWS+ichar(UKEYW(I))
- X UINWS=UINWS+UINW(I)
- X J=J+1
- X100 CONTINUE
- XC
- X USUM=MOD(UINWS,8)+(8*MOD(UKEYWS,8))
- XC !COMPUTE MASK.
- X DO 200 I=1,6
- X J=and(xor(xor(ichar(UINW(I)),ichar(UKEYW(I))),USUM),31)
- X USUM=MOD(USUM+1,32)
- X IF(J.GT.26) J=MOD(J,26)
- X OUTW(I)=char(MAX0(1,J)+64)
- X200 CONTINUE
- X RETURN
- XC
- X END
- XC CPGOTO-- MOVE TO NEXT STATE IN PUZZLE ROOM
- XC
- XC DECLARATIONS
- XC
- X SUBROUTINE CPGOTO(ST)
- X IMPLICIT INTEGER(A-Z)
- XC
- X COMMON /HYPER/ HFACTR
- X#include "rooms.h"
- X#include "rflag.h"
- X#include "rindex.h"
- X#include "objects.h"
- X#include "oflags.h"
- X#include "flags.h"
- XC CPGOTO, PAGE 2
- XC
- X RFLAG(CPUZZ)=and(RFLAG(CPUZZ),not(RSEEN))
- X DO 100 I=1,OLNT
- XC !RELOCATE OBJECTS.
- X IF((OROOM(I).EQ.CPUZZ).AND.
- X& (and(OFLAG2(I),(ACTRBT+VILLBT)).EQ.0))
- X& CALL NEWSTA(I,0,CPHERE*HFACTR,0,0)
- X IF(OROOM(I).EQ.(ST*HFACTR))
- X& CALL NEWSTA(I,0,CPUZZ,0,0)
- X100 CONTINUE
- X CPHERE=ST
- X RETURN
- XC
- X END
- XC CPINFO-- DESCRIBE PUZZLE ROOM
- XC
- XC DECLARATIONS
- XC
- X SUBROUTINE CPINFO(RMK,ST)
- X IMPLICIT INTEGER(A-Z)
- X INTEGER DGMOFT(8)
- X CHARACTER DGM(8),PICT(5),QMK
- XC
- X COMMON /CHAN/ INPCH,OUTCH,DBCH
- XC
- XC PUZZLE ROOM
- XC
- X COMMON /PUZZLE/ CPDR(16),CPWL(8),CPVEC(64)
- X#include "flags.h"
- XC
- XC FUNCTIONS AND LOCAL DATA
- XC
- XC
- X DATA DGMOFT/-9,-8,-7,-1,1,7,8,9/
- X#ifdef PDP
- XC
- XC PICT, DGM and QMK have been changed from two to
- XC one character in length. Puzout prints two copies.
- XC
- X DATA PICT/'S','S','S',' ','M'/
- X DATA QMK/'?'/
- X#else
- X DATA PICT/'SS','SS','SS',' ','MM'/
- X DATA QMK/'??'/
- X#endif PDP
- XC CPINFO, PAGE 2
- XC
- X CALL RSPEAK(RMK)
- X DO 100 I=1,8
- X J=DGMOFT(I)
- X DGM(I)=PICT(CPVEC(ST+J)+4)
- XC !GET PICTURE ELEMENT.
- X IF((IABS(J).EQ.1).OR.(IABS(J).EQ.8)) GO TO 100
- X K=8
- X IF(J.LT.0) K=-8
- XC !GET ORTHO DIR.
- X L=J-K
- X IF((CPVEC(ST+K).NE.0).AND.(CPVEC(ST+L).NE.0))
- X& DGM(I)=QMK
- X100 CONTINUE
- X#ifdef PDP
- X call puzout(DGM(1))
- X#else
- X WRITE(OUTCH,10) DGM
- X#endif
- XC
- X IF(ST.EQ.10) CALL RSPEAK(870)
- XC !AT HOLE?
- X IF(ST.EQ.37) CALL RSPEAK(871)
- XC !AT NICHE?
- X I=872
- XC !DOOR OPEN?
- X IF(CPOUTF) I=873
- X IF(ST.EQ.52) CALL RSPEAK(I)
- XC !AT DOOR?
- X IF(CPVEC(ST+1).EQ.-2) CALL RSPEAK(874)
- XC !EAST LADDER?
- X IF(CPVEC(ST-1).EQ.-3) CALL RSPEAK(875)
- XC !WEST LADDER?
- X RETURN
- XC
- X#ifndef PDP
- X10 FORMAT(' |',A2,1X,A2,1X,A2,'|'/,
- X& ' West |',A2,' .. ',A2,'| East',/
- X& ' |',A2,1X,A2,1X,A2,'|')
- X#endif PDP
- XC
- X END
- END_OF_dso7.F
- if test 2920 -ne `wc -c <dso7.F`; then
- echo shar: \"dso7.F\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f dungeon.sh -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"dungeon.sh\"
- else
- echo shar: Extracting \"dungeon.sh\" \(249 characters\)
- sed "s/^X//" >dungeon.sh <<'END_OF_dungeon.sh'
- X: sh script to invoke the dungeon game on the pdp
- XDLIB=/usr/games/lib/dunlib
- Xcase $# in
- X 0) $DLIB/listen| $DLIB/dungpdp| $DLIB/speak;;
- X 1) $DLIB/listen dungeon.sav| $DLIB/dungpdp| $DLIB/speak;;
- X *) $DLIB/listen $2| $DLIB/dungpdp| $DLIB/speak;;
- Xesac
- END_OF_dungeon.sh
- if test 249 -ne `wc -c <dungeon.sh`; then
- echo shar: \"dungeon.sh\" unpacked with wrong size!
- fi
- chmod +x dungeon.sh
- # end of overwriting check
- fi
- if test -f exits.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"exits.h\"
- else
- echo shar: Extracting \"exits.h\" \(45 characters\)
- sed "s/^X//" >exits.h <<'END_OF_exits.h'
- XC
- XC EXITS
- XC
- X COMMON /EXITS/ XLNT,TRAVEL(900)
- END_OF_exits.h
- if test 45 -ne `wc -c <exits.h`; then
- echo shar: \"exits.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f files.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"files.h\"
- else
- echo shar: Extracting \"files.h\" \(159 characters\)
- sed "s/^X//" >files.h <<'END_OF_files.h'
- X#ifndef DDIR
- X#define DDIR '/usr/games/lib/dunlib
- X#endif
- X
- X#define INDXFILE DDIR/dindx.dat'
- X#define TEXTFILE DDIR/dtext.dat'
- X#define RINDEXFILE DDIR/rtext.dat'
- END_OF_files.h
- if test 159 -ne `wc -c <files.h`; then
- echo shar: \"files.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f flags.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"flags.h\"
- else
- echo shar: Extracting \"flags.h\" \(1091 characters\)
- sed "s/^X//" >flags.h <<'END_OF_flags.h'
- XC
- XC FLAGS
- XC
- X LOGICAL TROLLF,CAGESF,BUCKTF,CAROFF,CAROZF,LWTIDF
- X LOGICAL DOMEF,GLACRF,ECHOF,RIDDLF,LLDF,CYCLOF
- X LOGICAL MAGICF,LITLDF,SAFEF,GNOMEF,GNODRF,MIRRMF
- X LOGICAL EGYPTF,ONPOLF,BLABF,BRIEFF,SUPERF,BUOYF
- X LOGICAL GRUNLF,GATEF,RAINBF,CAGETF,EMPTHF,DEFLAF
- X LOGICAL GLACMF,FROBZF,ENDGMF,BADLKF,THFENF,SINGSF
- X LOGICAL MRPSHF,MROPNF,WDOPNF,MR1F,MR2F,INQSTF
- X LOGICAL FOLLWF,SPELLF,CPOUTF,CPUSHF
- X COMMON /FINDEX/ TROLLF,CAGESF,BUCKTF,CAROFF,CAROZF,LWTIDF,
- X& DOMEF,GLACRF,ECHOF,RIDDLF,LLDF,CYCLOF,
- X& MAGICF,LITLDF,SAFEF,GNOMEF,GNODRF,MIRRMF,
- X& EGYPTF,ONPOLF,BLABF,BRIEFF,SUPERF,BUOYF,
- X& GRUNLF,GATEF,RAINBF,CAGETF,EMPTHF,DEFLAF,
- X& GLACMF,FROBZF,ENDGMF,BADLKF,THFENF,SINGSF,
- X& MRPSHF,MROPNF,WDOPNF,MR1F,MR2F,INQSTF,
- X& FOLLWF,SPELLF,CPOUTF,CPUSHF
- X COMMON /FINDEX/ BTIEF,BINFF
- X COMMON /FINDEX/ RVMNT,RVCLR,RVCYC,RVSND,RVGUA
- X COMMON /FINDEX/ ORRUG,ORCAND,ORMTCH,ORLAMP
- X COMMON /FINDEX/ MDIR,MLOC,POLEUF
- X COMMON /FINDEX/ QUESNO,NQATT,CORRCT
- X COMMON /FINDEX/ LCELL,PNUMB,ACELL,DCELL,CPHERE
- X
- X LOGICAL FLAGS(46)
- X EQUIVALENCE (FLAGS(1),TROLLF)
- X INTEGER SWITCH(22)
- X EQUIVALENCE (SWITCH(1), BTIEF)
- END_OF_flags.h
- if test 1091 -ne `wc -c <flags.h`; then
- echo shar: \"flags.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f gamestate.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"gamestate.h\"
- else
- echo shar: Extracting \"gamestate.h\" \(67 characters\)
- sed "s/^X//" >gamestate.h <<'END_OF_gamestate.h'
- XC
- XC GAME STATE
- XC
- X LOGICAL TELFLG
- X COMMON /PLAY/ WINNER,HERE,TELFLG
- END_OF_gamestate.h
- if test 67 -ne `wc -c <gamestate.h`; then
- echo shar: \"gamestate.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f io.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"io.h\"
- else
- echo shar: Extracting \"io.h\" \(101 characters\)
- sed "s/^X//" >io.h <<'END_OF_io.h'
- XC
- XC I/O VARIABLES
- XC
- X CHARACTER INBUF(78)
- X COMMON /INPUT/ INLNT,INBUF
- X COMMON /CHAN/ INPCH,OUTCH,DBCH
- END_OF_io.h
- if test 101 -ne `wc -c <io.h`; then
- echo shar: \"io.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f lightp.F -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"lightp.F\"
- else
- echo shar: Extracting \"lightp.F\" \(2424 characters\)
- sed "s/^X//" >lightp.F <<'END_OF_lightp.F'
- XC LIGHTP- LIGHT PROCESSOR
- XC
- XC COPYRIGHT 1980, INFOCOM COMPUTERS AND COMMUNICATIONS, CAMBRIDGE MA. 02142
- XC ALL RIGHTS RESERVED, COMMERCIAL USAGE STRICTLY PROHIBITED
- XC WRITTEN BY R. M. SUPNIK
- XC
- XC DECLARATIONS
- XC
- X LOGICAL FUNCTION LIGHTP(OBJ)
- X IMPLICIT INTEGER (A-Z)
- X LOGICAL QON
- X#include "parser.h"
- X#include "gamestate.h"
- X#include "objects.h"
- X#include "oflags.h"
- X#include "oindex.h"
- X#include "clock.h"
- X
- X#include "verbs.h"
- X#include "flags.h"
- XC
- XC FUNCTIONS AND DATA
- XC
- X QON(R)=and(OFLAG1(R),ONBT).NE.0
- XC LIGHTP, PAGE 2
- XC
- X LIGHTP=.TRUE.
- XC !ASSUME WINS
- X FLOBTS=FLAMBT+LITEBT+ONBT
- X IF(OBJ.NE.CANDL) GO TO 20000
- XC !CANDLE?
- X IF(ORCAND.NE.0) GO TO 19100
- XC !FIRST REF?
- X ORCAND=1
- XC !YES, CANDLES ARE
- X CTICK(CEVCND)=50
- XC !BURNING WHEN SEEN.
- XC
- X19100 IF(PRSI.EQ.CANDL) GO TO 10
- XC !IGNORE IND REFS.
- X IF(PRSA.NE.TRNOFW) GO TO 19200
- XC !TURN OFF?
- X I=513
- XC !ASSUME OFF.
- X IF(QON(CANDL)) I=514
- XC !IF ON, DIFFERENT.
- X CFLAG(CEVCND)=.FALSE.
- XC !DISABLE COUNTDOWN.
- X OFLAG1(CANDL)=and(OFLAG1(CANDL), not(ONBT))
- X CALL RSPEAK(I)
- X RETURN
- XC
- X19200 IF((PRSA.NE.BURNW).AND.(PRSA.NE.TRNONW)) GO TO 10
- X IF(and(OFLAG1(CANDL),LITEBT).NE.0) GO TO 19300
- X CALL RSPEAK(515)
- XC !CANDLES TOO SHORT.
- X RETURN
- XC
- X19300 IF(PRSI.NE.0) GO TO 19400
- XC !ANY FLAME?
- X CALL RSPEAK(516)
- XC !NO, LOSE.
- X PRSWON=.FALSE.
- X RETURN
- XC
- X19400 IF((PRSI.NE.MATCH).OR. .NOT.QON(MATCH)) GO TO 19500
- X I=517
- XC !ASSUME OFF.
- X IF(QON(CANDL)) I=518
- XC !IF ON, JOKE.
- X OFLAG1(CANDL)=or(OFLAG1(CANDL),ONBT)
- X CFLAG(CEVCND)=.TRUE.
- XC !RESUME COUNTDOWN.
- X CALL RSPEAK(I)
- X RETURN
- XC
- X19500 IF((PRSI.NE.TORCH).OR. .NOT.QON(TORCH)) GO TO 19600
- X IF(QON(CANDL)) GO TO 19700
- XC !ALREADY ON?
- X CALL NEWSTA(CANDL,521,0,0,0)
- XC !NO, VAPORIZE.
- X RETURN
- XC
- X19600 CALL RSPEAK(519)
- XC !CANT LIGHT WITH THAT.
- X RETURN
- XC
- X19700 CALL RSPEAK(520)
- XC !ALREADY ON.
- X RETURN
- XC
- X20000 IF(OBJ.NE.MATCH) CALL BUG(6,OBJ)
- X IF((PRSA.NE.TRNONW).OR.(PRSO.NE.MATCH)) GO TO 20500
- X IF(ORMTCH.NE.0) GO TO 20100
- XC !ANY MATCHES LEFT?
- X CALL RSPEAK(183)
- XC !NO, LOSE.
- X RETURN
- XC
- X20100 ORMTCH=ORMTCH-1
- XC !DECREMENT NO MATCHES.
- X OFLAG1(MATCH)=or(OFLAG1(MATCH),FLOBTS)
- X CTICK(CEVMAT)=2
- XC !COUNTDOWN.
- X CALL RSPEAK(184)
- X RETURN
- XC
- X20500 IF((PRSA.NE.TRNOFW).OR.(and(OFLAG1(MATCH),ONBT).EQ.0))
- X& GO TO 10
- X OFLAG1(MATCH)=and(OFLAG1(MATCH), not(FLOBTS))
- X CTICK(CEVMAT)=0
- X CALL RSPEAK(185)
- X RETURN
- XC
- XC HERE FOR FALSE RETURN
- XC
- X10 LIGHTP=.FALSE.
- X RETURN
- X END
- END_OF_lightp.F
- if test 2424 -ne `wc -c <lightp.F`; then
- echo shar: \"lightp.F\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f listen.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"listen.c\"
- else
- echo shar: Extracting \"listen.c\" \(1090 characters\)
- sed "s/^X//" >listen.c <<'END_OF_listen.c'
- X#include <stdio.h>
- X
- X#ifndef CINDEXFILE
- X#define CINDEXFILE "/usr/games/lib/dunlib/dindx.dat"
- X#endif
- X
- Xmain(numargs, argptr)
- X
- Xint numargs;
- Xchar *argptr[];
- X{
- Xint chr;
- XFILE *fpin;
- X
- X
- X fprintf(stderr,"Yawn... \n");
- X
- X/* open init file */
- X fpin = fopen(CINDEXFILE, "r");
- X if (fpin == NULL) {
- X fclose(fpin);
- X fprintf(stderr,"Init file missing.\n");
- X exit(0);
- X }
- X
- X/* transfer init file into the pipe */
- X
- X while ((chr = getc(fpin)) != EOF)
- X putchar((char)chr);
- X
- X fclose(fpin);
- X
- X/* check for restore file argument */
- X
- X if(numargs > 1){
- X fpin = fopen(*++argptr,"r");
- X if( fpin == NULL)
- X fprintf(stderr,"Restore file missing.\n");
- X
- X else {
- X putchar('R');
- X while((chr = getc(fpin)) != EOF)
- X putchar((char)chr);
- X fprintf(stderr,"Now, where were we...\n");
- X fclose(fpin);
- X }
- X }
- X
- X fprintf(stderr,"Oh hello .. \n");
- X
- X/* send end of init data flag */
- X
- X putchar('?');
- X fflush(stdout);
- X
- X/* send lines of standard input to pipe */
- X
- X while ((chr = getchar()) != EOF){
- X putchar(chr);
- X if (chr == '\n')
- X fflush(stdout);
- X }
- X
- X/* end the process */
- X fprintf(stderr,"Goodnight .. \n");
- X}
- END_OF_listen.c
- if test 1090 -ne `wc -c <listen.c`; then
- echo shar: \"listen.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f mindex.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"mindex.h\"
- else
- echo shar: Extracting \"mindex.h\" \(52 characters\)
- sed "s/^X//" >mindex.h <<'END_OF_mindex.h'
- XC
- XC MESSAGE INDEX
- XC
- X COMMON /RMSG/ MLNT,RTEXT(1050)
- END_OF_mindex.h
- if test 52 -ne `wc -c <mindex.h`; then
- echo shar: \"mindex.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f oindex.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"oindex.h\"
- else
- echo shar: Extracting \"oindex.h\" \(1068 characters\)
- sed "s/^X//" >oindex.h <<'END_OF_oindex.h'
- XC
- X COMMON /OINDEX/ GARLI,FOOD,GUNK,COAL,MACHI,DIAMO,TCASE,BOTTL
- X COMMON /OINDEX/ WATER,ROPE,KNIFE,SWORD,LAMP,BLAMP,RUG
- X COMMON /OINDEX/ LEAVE,TROLL,AXE
- X COMMON /OINDEX/ RKNIF,KEYS,ICE,BAR
- X COMMON /OINDEX/ COFFI,TORCH,TBASK,FBASK,IRBOX
- X COMMON /OINDEX/ GHOST,TRUNK,BELL,BOOK,CANDL
- X COMMON /OINDEX/ MATCH,TUBE,PUTTY,WRENC,SCREW,CYCLO,CHALI
- X COMMON /OINDEX/ THIEF,STILL,WINDO,GRATE,DOOR
- X COMMON /OINDEX/ HPOLE,LEAK,RBUTT,RAILI
- X COMMON /OINDEX/ POT,STATU,IBOAT,DBOAT,PUMP,RBOAT
- X COMMON /OINDEX/ STICK,BUOY,SHOVE,BALLO,RECEP,GUANO
- X COMMON /OINDEX/ BROPE,HOOK1,HOOK2,SAFE,SSLOT,BRICK,FUSE
- X COMMON /OINDEX/ GNOME,BLABE,DBALL,TOMB
- X COMMON /OINDEX/ LCASE,CAGE,RCAGE,SPHER,SQBUT
- X COMMON /OINDEX/ FLASK,POOL,SAFFR,BUCKE,ECAKE,ORICE,RDICE,BLICE
- X COMMON /OINDEX/ ROBOT,FTREE,BILLS,PORTR,SCOL,ZGNOM
- X COMMON /OINDEX/ EGG,BEGG,BAUBL,CANAR,BCANA
- X COMMON /OINDEX/ YLWAL,RDWAL,PINDR,RBEAM
- X COMMON /OINDEX/ ODOOR,QDOOR,CDOOR,NUM1,NUM8
- X COMMON /OINDEX/ WARNI,CSLIT,GCARD,STLDR
- X COMMON /OINDEX/ HANDS,WALL,LUNGS,SAILO,AVIAT,TEETH
- X COMMON /OINDEX/ ITOBJ,EVERY,VALUA,OPLAY,WNORT,GWATE,MASTER
- END_OF_oindex.h
- if test 1068 -ne `wc -c <oindex.h`; then
- echo shar: \"oindex.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f parser.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"parser.h\"
- else
- echo shar: Extracting \"parser.h\" \(571 characters\)
- sed "s/^X//" >parser.h <<'END_OF_parser.h'
- XC
- XC PARSER OUTPUT
- XC
- X LOGICAL PRSWON
- X COMMON /PRSVEC/ PRSA,PRSI,PRSO,PRSWON,PRSCON
- XC
- XC PARSER STATE
- XC
- X COMMON /ORPHS/ OFLAG,OACT,OSLOT,OPREP,ONAME
- X INTEGER ORP(5)
- X EQUIVALENCE (OFLAG, ORP)
- XC
- X COMMON /LAST/ LASTIT
- XC
- X COMMON /PV/ ACT,O1,O2,P1,P2
- X INTEGER OBJVEC(2),PRPVEC(2),PVEC(5)
- X EQUIVALENCE (OBJVEC(1),O1),(PRPVEC(1),P1),(PVEC,ACT)
- XC
- X COMMON /SYNTAX/ VFLAG,DOBJ,DFL1,DFL2,DFW1,DFW2,
- X& IOBJ,IFL1,IFL2,IFW1,IFW2
- X INTEGER SYN(11)
- X EQUIVALENCE (VFLAG, SYN)
- XC
- X COMMON /SYNFLG/ SDIR,SIND,SSTD,SFLIP,SDRIV,SVMASK
- XC
- X COMMON /OBJFLG/ VABIT,VRBIT,VTBIT,VCBIT,VEBIT,VFBIT,VPMASK
- END_OF_parser.h
- if test 571 -ne `wc -c <parser.h`; then
- echo shar: \"parser.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f puzzle.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"puzzle.h\"
- else
- echo shar: Extracting \"puzzle.h\" \(68 characters\)
- sed "s/^X//" >puzzle.h <<'END_OF_puzzle.h'
- XC
- XC PUZZLE ROOM STATE
- XC
- X COMMON /PUZZLE/ CPDR(16),CPWL(8),CPVEC(64)
- END_OF_puzzle.h
- if test 68 -ne `wc -c <puzzle.h`; then
- echo shar: \"puzzle.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f rflag.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"rflag.h\"
- else
- echo shar: Extracting \"rflag.h\" \(97 characters\)
- sed "s/^X//" >rflag.h <<'END_OF_rflag.h'
- XC
- X COMMON /RFLAG/ RSEEN,RLIGHT,RLAND,RWATER,RAIR,
- X& RSACRD,RFILL,RMUNG,RBUCK,RHOUSE,RNWALL,REND
- END_OF_rflag.h
- if test 97 -ne `wc -c <rflag.h`; then
- echo shar: \"rflag.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f rooms.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"rooms.h\"
- else
- echo shar: Extracting \"rooms.h\" \(193 characters\)
- sed "s/^X//" >rooms.h <<'END_OF_rooms.h'
- XC
- XC ROOMS
- XC
- X COMMON /ROOMS/ RLNT,RDESC2,RDESC1(200),REXIT(200),
- X& RACTIO(200),RVAL(200),RFLAG(200)
- X INTEGER RRAND(200)
- X EQUIVALENCE (RVAL,RRAND)
- X INTEGER EQR(200,5)
- X EQUIVALENCE (RDESC1, EQR)
- END_OF_rooms.h
- if test 193 -ne `wc -c <rooms.h`; then
- echo shar: \"rooms.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f rtim.c -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"rtim.c\"
- else
- echo shar: Extracting \"rtim.c\" \(906 characters\)
- sed "s/^X//" >rtim.c <<'END_OF_rtim.c'
- X/*
- X * Interface routines for dungeon.
- X * These routines are for functions expected by the game
- X * that are not available in the Unix/f77 library.
- X */
- X
- X/* routine to get time in hours minutes and seconds */
- X
- X#include <sys/types.h>
- X#include <sys/timeb.h>
- X/* for V7 this should be <time.h> */
- X#include <sys/time.h>
- X
- X
- Xlong time();
- Xstruct tm *localtime();
- Xstruct tm *tmptr;
- Xlong timebuf;
- X
- Xitime_(hrptr,minptr,secptr)
- X
- Xint *hrptr,*minptr,*secptr;
- X{
- X
- X time(&timebuf);
- X tmptr = localtime(&timebuf);
- X
- X *hrptr = tmptr->tm_hour;
- X *minptr = tmptr->tm_min;
- X *secptr = tmptr->tm_sec;
- X
- X return;
- X}
- X
- X/* random number initializer */
- Xinirnd_(seedptr)
- X
- Xint *seedptr;
- X{
- Xint seed;
- X
- X seed = *seedptr;
- X srand(seed);
- X return;
- X}
- X
- X/* random number generator */
- Xrnd_(maxval)
- X
- Xint *maxval;
- X{
- X/* note: returned random number ranges from 0 to maxval */
- X
- Xint rndval;
- X
- X rndval = rand();
- X
- X rndval = rndval % *maxval;
- X
- X return(rndval);
- X}
- END_OF_rtim.c
- if test 906 -ne `wc -c <rtim.c`; then
- echo shar: \"rtim.c\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f screen.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"screen.h\"
- else
- echo shar: Extracting \"screen.h\" \(98 characters\)
- sed "s/^X//" >screen.h <<'END_OF_screen.h'
- XC
- XC SCREEN OF LIGHT
- XC
- X COMMON /SCREEN/ FROMDR,SCOLRM,SCOLAC
- X COMMON /SCREEN/ SCOLDR(8),SCOLWL(12)
- END_OF_screen.h
- if test 98 -ne `wc -c <screen.h`; then
- echo shar: \"screen.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f state.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"state.h\"
- else
- echo shar: Extracting \"state.h\" \(90 characters\)
- sed "s/^X//" >state.h <<'END_OF_state.h'
- X COMMON /STATE/ MOVES,DEATHS,RWSCOR,MXSCOR,MXLOAD,
- X& LTSHFT,BLOC,MUNGRM,HS,EGSCOR,EGMXSC
- END_OF_state.h
- if test 90 -ne `wc -c <state.h`; then
- echo shar: \"state.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f villians.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"villians.h\"
- else
- echo shar: Extracting \"villians.h\" \(222 characters\)
- sed "s/^X//" >villians.h <<'END_OF_villians.h'
- XC
- XC VILLAINS AND DEMONS
- XC
- X LOGICAL THFFLG,SWDACT,THFACT
- X COMMON /HACK/ THFPOS,THFFLG,THFACT,SWDACT,SWDSTA
- XC
- X COMMON /VILL/ VLNT,VILLNS(4),VPROB(4),VOPPS(4),VBEST(4),VMELEE(4)
- XC
- X INTEGER EQV(4,5)
- X EQUIVALENCE (VILLNS, EQV)
- END_OF_villians.h
- if test 222 -ne `wc -c <villians.h`; then
- echo shar: \"villians.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f vocab.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"vocab.h\"
- else
- echo shar: Extracting \"vocab.h\" \(556 characters\)
- sed "s/^X//" >vocab.h <<'END_OF_vocab.h'
- XC
- XC VOCABULARIES
- XC
- X COMMON /BUZVOC/ BVOC(20)
- X COMMON /PRPVOC/ PVOC(45)
- X COMMON /DIRVOC/ DVOC(75)
- X INTEGER AVOC(450)
- X COMMON /ADJVOC/ AVOC1(184),AVOC2(114),AVOC3(106),AVOCND
- X INTEGER VVOC(950)
- X COMMON /VRBVOC/ VVOC1(92),VVOC1A(108),VVOC1B(38),VVOC2(104),
- X& VVOC3(136),
- X& VVOC4(116),VVOC5(134),VVOC6(117),VVOC7(89),VVOCND
- X INTEGER OVOC(1050)
- X COMMON /OBJVOC/ OVOC1(159),OVOC2(144),OVOC3(150),OVOC4(128),
- X& OVOC5(111),OVOC6(104),OVOC6A(97),OVOC7(127),OVOCND
- XC
- X EQUIVALENCE (VVOC(1),VVOC1(1))
- X EQUIVALENCE (AVOC(1),AVOC1(1))
- X EQUIVALENCE (OVOC(1),OVOC1(1))
- END_OF_vocab.h
- if test 556 -ne `wc -c <vocab.h`; then
- echo shar: \"vocab.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f xpars.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"xpars.h\"
- else
- echo shar: Extracting \"xpars.h\" \(95 characters\)
- sed "s/^X//" >xpars.h <<'END_OF_xpars.h'
- XC
- X COMMON /XPARS/ XRMASK,XDMASK,XFMASK,XFSHFT,XASHFT,
- X& XELNT(4),XNORM,XNO,XCOND,XDOOR,XLFLAG
- END_OF_xpars.h
- if test 95 -ne `wc -c <xpars.h`; then
- echo shar: \"xpars.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- if test -f xsrch.h -a "${1}" != "-c" ; then
- echo shar: Will not over-write existing file \"xsrch.h\"
- else
- echo shar: Extracting \"xsrch.h\" \(81 characters\)
- sed "s/^X//" >xsrch.h <<'END_OF_xsrch.h'
- XC
- X COMMON /XSRCH/ XMIN,XMAX,XDOWN,XUP,
- X& XNORTH,XSOUTH,XENTER,XEXIT,XEAST,XWEST
- END_OF_xsrch.h
- if test 81 -ne `wc -c <xsrch.h`; then
- echo shar: \"xsrch.h\" unpacked with wrong size!
- fi
- # end of overwriting check
- fi
- echo shar: End of archive 7 \(of 14\).
- cp /dev/null ark7isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 14 archives.
- rm -f ark[1-9]isdone ark1[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-